package com.scorpio.goods.vo;

import com.scorpio.common.utils.verification.AddGroup;
import com.scorpio.common.utils.verification.DefaultGroup;
import com.scorpio.common.utils.verification.UpdateGroup;

import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;

public class AddGoodsSpecVo {

    @NotNull(message = "无效更新", groups = UpdateGroup.class)
    private Long id;

    //关联商品
    @NotNull(message = "无效关联商品", groups = AddGroup.class)
    private Long goodsId;

    @Valid
    @NotNull(message = "无效的提交sku数据")
    private List<AddGoodsSkuSpecVo> skuList;

    //原价
    @NotNull(message = "未设置原价", groups = DefaultGroup.class)
    @DecimalMin(value = "0", message = "原价参数无效", groups = DefaultGroup.class)
    @DecimalMax(value = "99999999", message = "原价最大为99999", groups = DefaultGroup.class)
    private Float originalPrice;

    //现价
    @NotNull(message = "未设置现价", groups = DefaultGroup.class)
    @DecimalMin(value = "0", message = "现价参数无效", groups = DefaultGroup.class)
    @DecimalMax(value = "99999999", message = "现价最大为99999", groups = DefaultGroup.class)
    private Float presentPrice;

    //初始库存
    @NotNull(message = "初始库存无效", groups = AddGroup.class)
    @Min(value = 0, message = "库存参数无效", groups = AddGroup.class)
    @Max(value = 99999, message = "库存最大为99999", groups = AddGroup.class)
    private Integer inventoryTotal;

    //状态
    @NotBlank(message = "状态不能为空", groups = DefaultGroup.class)
    private String status;

    //商品图片
    @NotBlank(message = "缺少商品图片", groups = DefaultGroup.class)
    private String image;

    //优先级
    private Integer sort;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public List<AddGoodsSkuSpecVo> getSkuList() {
        return skuList;
    }

    public void setSkuList(List<AddGoodsSkuSpecVo> skuList) {
        this.skuList = skuList;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public Float getOriginalPrice() {
        return originalPrice;
    }

    public void setOriginalPrice(Float originalPrice) {
        this.originalPrice = originalPrice;
    }

    public Float getPresentPrice() {
        return presentPrice;
    }

    public void setPresentPrice(Float presentPrice) {
        this.presentPrice = presentPrice;
    }

    public Integer getInventoryTotal() {
        return inventoryTotal;
    }

    public void setInventoryTotal(Integer inventoryTotal) {
        this.inventoryTotal = inventoryTotal;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }
}
